package AbstractTransactions

import (
	"Salary/Model"
	"Salary/TransactionApplication"
)

type AddTransaction interface {
	GetClassification() Model.PaymentClassification
	GetSchedule() Model.PaymentSchedule
}

type AddEmployeeTransaction struct {
	TransactionApplication.Transaction
	AddTransaction
	itsEmpid            int
	itsName, itsAddress string
}

func (its *AddEmployeeTransaction) AddEmployeeTransaction(empid int, name string, address string) {
	its.itsEmpid = empid
	its.itsName = name
	its.itsAddress = address
}

func (ch *AddEmployeeTransaction) Execute() {
	pc := ch.GetClassification()
	ps := ch.GetSchedule()
	//pm := ModelImplementation.HoldMethod{}
	e := Model.SetEmployee(ch.itsEmpid, ch.itsName, ch.itsAddress)
	e.SetSchedule(ps)
	e.SetClassification(pc)
	//e.SetMethod(pm)
	//DataBase.PayrollDatabase.AddEmployee(e.GetEmpid(), e)
}
